<?php
	$form_bean = array(
		array(
			'field'	=>	'goodsclass[id]', 
			'item' 	=>	'hidden'
		),
		array(
			'label'	=>	'父级分类',
			'items'	=>	array(
				array(
					'field'	=>	'goodsclass[parentid]',
					'item'	=>	'hidden',
					'value'	=>	0
				),
				array(
					'field'	=>	'goodsclass[parentname]',
					'item'	=>	'label',
					'value'	=> 	'无'
				),
				array(
					'field'	=>	'chooseparent',
					'item'	=>	'button',
					'value'	=>	'点击选择',
					'event'	=>	'
						$("#chooseparent").colorbox({href:"'.site_url('/manager/goods/classes/choice').'/"+document.getElementById("goodsclass_parentid").value+"?m=init",
						onClosed:function(){
							$(".selectBox a").die();
						}});
					'
				)
			)
		),
		array(
			'label' =>	'分类名称',
			'field' =>	'goodsclass[name]',
			'item'  =>	'text',
			'rules' =>	'required|alpha_chinese_dash|min_length:4|max_length:64|is_exist:'.site_url('/manager/goods/classes/isExistName'),
			'msg'	=>	'请填写：汉字/字母/数字（4~64个字符，1汉字=2个字符）。'
		),
		array(
			'label' =>	'关联产品类型',
			'items'	=>	array(
				array(
					'field' =>	'goodsclass[typeid]',
					'item'  =>	'hidden',
					'value' =>	0
				),
				array(
					'field'	=>	'goodsclass[typename]',
					'item'	=>	'label',
					'value'	=> 	'--'
				),
				array(
					'field'	=>	'choosetypeid',
					'item'	=>	'button',
					'value'	=>	'点击选择',
					'event'	=>	'
						$("#choosetypeid").colorbox({href:"'.site_url('/manager/goods/type/choice').'",
						onClosed:function(){
							$(".selectBox a").die();
						}});
					',
					'msg'	=>	'仅限最低分类有效！'
				)
			)
		),
		array(
			'label' =>	'返点',
			'field'	=>	'goodsclass[rebate]',
			'item'	=>	'text:size=1',
			'rules'	=>	'decimal|greater_than:0|less_than:100',
			'msg'	=>	'请填写：0~100范围内的小数（精确2位）;单位：% 。'
		),
		array(
			'label' =>	'是否显示在分类导航',
			'field'	=>	'goodsclass[isshow]',
			'item'	=>	'radio:{"1":"是","0":"否"}',
			'value'	=>	0
		),
		array(
			'label' =>	'排序',
			'field'	=>	'goodsclass[sort]',
			'item'	=>	'text:size=1',
			'rules'	=>	'numeric',
			'msg'	=>	'请填写：数字。'
		),
		array(
			'label' =>	'Title',
			'field' =>	'goodsclass[title]',
			'item'  =>	'text',
			'rules' =>	'alpha_chinese_dash|max_length:64',
			'msg'	=>	'请填写：汉字/字母/数字（最多64个字符，1汉字=2个字符）。'
		),
		array(
			'label' =>	'Keywords',
			'field' =>	'goodsclass[keywords]',
			'item'  =>	'text:size=60',
			'rules' =>	'alpha_chinese_dash|max_length:128',
			'msg'	=>	'请填写：汉字/字母/数字（最多128个字符，1汉字=2个字符）。'
		),
		array(
			'label' =>	'Description',
			'field' =>	'goodsclass[description]',
			'item'  =>	'textarea',
			'rules' =>	'alpha_chinese_dash|max_length:255',
			'msg'	=>	'请填写：汉字/字母/数字（最多255个字符，1汉字=2个字符）。'
		),
		array(
			'label'	=>	'',
			'items'	=>	array(
				array(
					'item'	=>	'submit',
					'type'	=>	'ajax',
					'value'	=>	'提交'
				),
				array(
					'item'	=>	'reset',
					'value'	=>	'重置'
				)
			)
		)
	);
?>